package com.stud.dustteam.model;

import javax.persistence.*;
import java.util.HashSet;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: Shady
 * Date: 11.11.12
 * Time: 13:20
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "Product")
public class Product {

    private Set<OrderForSign> orderForSigns = new HashSet<OrderForSign>(0);
    private Integer id;
    private String name;
    private Double price;
    private String description;

    public Product() {

    }

    @Id
    @GeneratedValue
    @Column(name = "product_id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column(name = "price")
    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
    public Set<OrderForSign> getOrderForSigns() {
        return orderForSigns;
    }

    public void setOrderForSigns(Set<OrderForSign> orderForSigns) {
        this.orderForSigns = orderForSigns;
    }
}
